risk management and reliable forecasting using un-reliable data (magennis) - lkce 2014

54
Risk Management and Reliable Forecasting Using Un-Reliable Data First Presented at Lean Kanban Central Europe, Hamburg. November 2014 Troy Magennis Twitter: @t_magennis Get Slides: http://bitly.com/1E9Hh8l

Upload: focusedobjective

Post on 30-Jun-2015

884 views

Category:

Software


2 download

DESCRIPTION

To meet expectations and optimize flow, managing risk is an important part of Kanban. Anticipating and adapting to things that "go wrong" and the uncertainty they cause is topic of this session. We look at techniques for quantifying what risks should be considered important to deal with. Although discouraging, forecasting size, effort, staff and cost is sometimes necessary. Of course we have to do as little of this as possible, but when we do, we have to do it well with the data we have available. Forecasting is made difficult by un-reliable information as inputs to our process – the amount of work is uncertain, the historical data we are basing our forecasts on is biased and tainted, the situation seems hopeless. But it isn't. Good decisions can be made on imperfect data, and this session discusses how. This session shows immediately usable and simple techniques to capture, analyze, cleanse and assess data, and then use that data for reliable forecasting. Second and hopefully draft of LKCE 2014 talk.

TRANSCRIPT

Page 1: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

Risk Management and Reliable Forecasting Using Un-Reliable Data

First Presented at Lean Kanban Central Europe, Hamburg. November 2014

Troy Magennis Twitter: @t_magennis

Get Slides: http://bitly.com/1E9Hh8l

Page 2: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis2

Don’t Follow the Light

Page 3: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

3

Question Current Approaches to…

EstimationForecasting

Risk

Page 4: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

4

Sources of Forecast

Risk

Work

Throughput

Dependencies

Page 5: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

6 @t_magennisPeople

Page 6: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis7

People

• People are biased – intentionally and/or un-intentionally

• In order to forecast and manage risk– We need good expert opinions– We need to confirm these opinions against reality– We need to learn from our forecast errors

• Often we get opinions on a fractional understanding of the eventual problem solved

Page 7: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis8

Not Getting Data(At All or Early Enough)

Page 8: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis9

Getting Reliable Data from People

• Why would people take the time?– We tell them (rarely works as intended)– Was politely ask them (works sometimes)– We make it part of their self-interest (most likely)

• Gamification• Challenge their view on fairness

• NEVER: Embarrass a team or individual– you will totally destroy reliable data capture….

Page 9: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

10

Strategy 1 – “Gamify” Presentation

Interactive charts get attention, vibrant colors for teams with good data

TeamsStrategies

Features

Teams don’t like being “Red”(default to red; teams will make them green)

Coloring teams in dull (grey) based on poor quality data capture often gets action.

Make it sexy. Show how “my” metric connects to strategy

Page 10: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis11

Strategy 2 – Visibility to Decisions

• Operations Reviews! Giving meaning to data!• Make it clear when data has led to decisions

– “Based on the data and analysis presented, this is clearly an opportunity we will pursue.”

– “Lets track the first month actuals against the model and fully invest if it is tracking well.”

• Make it clear when more data would have “won”• “If I could clearly see the impact of giving you those extra team members,

this would be easy”

• Promote lively debate around data– React quickly if data presented is gamed or teams repetitively

fail against THEIR models

Page 11: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis12

Strategy 3 – Perceived Fairness

• One team gets some “extra” attention based on an argument supported by data– Extra resources, More Investment– More time to demo

• With just a few examples, often there is an avalanche of willing metric support by others

• Make it clear why the data swayed a decision

Page 12: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis13

Uncertain Data Quality

Page 13: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis14

Checking for Gaming & Errors

• We can ask tougher questions– What assumptions are built into this forecast?

• Why would we be 2x better than we ever have before?

– Walk me through the logic supporting your analysis– Looking at historical data, we predict very poorly when

there are 3 or more dependent teams. Have you considered this?

• We can test for unlikely patterns– Distribution analysis– Benford’s Law

Page 14: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

15 @t_magennis

Throughput per week

Evidence of data quality is a well formed and explainable

distribution shape

Customer: “Our data is crap. You can’t use any of it”

Page 15: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis16

Distribution Shape & Outliers

• Plot visually using Histogram• Set a rule: E.g. >10 times the mode? (state it)

Mode is 3

50 & 100 are outliers worth discussion..

Page 16: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis17

Benford’s Law

• Benford's Law, also called the First-Digit Law, refers to the frequency distribution of digits in many real-life sources of data.

• Know to apply to: electricity bills, street addresses, stock prices, population numbers, death rates, lengths of rivers, …, and processes described by power laws.

Source: Wikipedia

Common in story counts per epics in software projects. Also probable in lead time cycle time values.

Page 17: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis18

Benford’s Law Applied to Story Count

• Story count estimate for 48 randomly picked epics

• The frequency of the first digits was computed

• These were compared to Benford’s prediction (green within 1.5%)

dBenford’s Prediction

P(d)

Actual DataP(d)

1 30.1% 31.3%2 17.6% 18.8%3 12.5% 20.8%4 9.7% 8.3%5 7.9% 8.3%6 6.7% 8.3%7 5.8% 0%8 5.1% 4.2%9 4.6% 0%

Based on real data n = 48

Page 18: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis19

Data Analysis Spreadsheethttps://github.com/FocusedObjective/FocusedObjective.Resources

Page 19: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

20Data

Page 20: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis21

Forecasting using data without considering context

Page 21: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis22

Throughput Trend by Week

W2-2012 W10-2012 W18-2012 W26-2012 W34-2012 W42-2012 W50-2012 W4-2013 W12-2013 W20-2013 W28-2013 W36-2013 W44-2013 W52-2013 W7-2014 W15-20140

200

400

600

800

1000

1200

1400

1600

All Enabling Spec Bugs NFRs

Page 22: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis23

Throughput Trend by Week

W2-2012 W10-2012 W18-2012 W26-2012 W34-2012 W42-2012 W50-2012 W4-2013 W12-2013 W20-2013 W28-2013 W36-2013 W44-2013 W52-2013 W7-2014 W15-20140

200

400

600

800

1000

1200

1400

1600

All Enabling Spec Bugs NFRs

Page 23: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis24

Throughput Trend by Week

W2-2012 W10-2012 W18-2012 W26-2012 W34-2012 W42-2012 W50-2012 W4-2013 W12-2013 W20-2013 W28-2013 W36-2013 W44-2013 W52-2013 W7-2014 W15-20140

200

400

600

800

1000

1200

1400

1600

All Enabling Spec Bugs NFRs

High Volatility

Decline?

Restructure?

Training? Coaches added

end of year break

Page 24: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis25

Good Contextual Forecasting

• Know the past– Track the date of significant company events

• Reorgs, releases, competitor releases,

– Track reference data that may show context• Staff numbers by date, National Holidays

– Markup all charts and data with context labels• Consider the future

– What events are likely over the forecast period– Draw samples considering these contexts

Page 25: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis26

Some Context Events…• Internal differences in team skills• Any change (Hawthorn Effect)• Change of Risk Profile• Unstable WIP• Poor Quality• Unstable Test Environment• Seasons - Vacations• Executive Re-org• Natural Disasters• Exceptional Sickness• Changes in Staff• Team Changes• Location• Environmental Disturbance• Moral Shifts• Process Change• Architectural Change• Fatigue (Low Work Moral)• Change of demand for different classes of service• Account of Expedites• Changes in how to measure• Poor record keeping• Delivery frequency / cadence• Org changes / staffing

• Gaming the System• Mergers and Acquisitions• Multi tasking• High attrition rates• Staff availability due to prod issues• Critical specialists not available• Introduce new technology• Technical architectural changes• Legal requirements (date fixed)• Beginning the project• User stories too large• Dependency identification• Technical complexity• External spot demands• Changing prioritization• Expedited work• External dependencies• Better coffee• Relevant training• Process changes• Process problem moving tickets• New management policy

Page 26: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis27

Forecasting using poor estimates from “Experts”

“Uncertain Uncertainty”

Page 27: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis28

Improving Estimates

Stop• Point estimates• Ignoring uncertainty• Thinking it’s easy• “Never speak of this again”• Inventing units (points)• Rewarding gaming• Tolerating ambiguity

Start• Using Range estimates• Expressing Un-certainty• Train & practice estimation• Learning with feedback• Using dollars, time, counts• Rewarding honesty• Presenting unbiased data

Page 28: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis31

http://ccnss.org/materials/pdf/sigman/callibration_probabilities_lichtenstein_fischoff_philips.pdf

Page 29: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

32

Estimation Training

• How sure you are about guesses?• This can be practiced• Calibration – Trivia Game

– Ask a question about a known actual– Ask people to guess the range

• “True or False: "A hockey puck fits in a golf hole” • “Confidence: Choose the probability that best

represents your chance of getting this question right...

50% 60% 70% 80% 90% 100%”

– Disclose the result – 50% (no idea) should get 50% of the questions right by guess alone

Source: http://en.wikipedia.org/wiki/Calibrated_probability_assessment

Page 30: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis33

No Lead Time Data?

• No team yet? No history?• We need two estimates with probability

– 1 in 5 tasks should take less than 1 day– 4 in 5 tasks should take less than 5 days

• We need to solve the curve that fits these two probabilities (and hopefully the others)

Page 31: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis34

http://bit.ly/1tC1Phy

• Why lead time is Weibull, Why you care…

Page 32: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis35

80% <= 5 Days(4 in 5)

20% <= 1 Day(1 in 5)

How do we get experts to estimate ranges and predict higher order percentiles from two estimates?

Page 33: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

36

80% <= 5 Days

20% <= 1 Day

p2 x2

p1 x1

See detailed paper on the mathematics: http://www.johndcook.com/quantiles_parameters.pdf

?

Page 34: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

37

https://github.com/FocusedObjective/FocusedObjective.Resources

Excel Formula: =(LN(-LN(1-p2_param))-LN(-LN(1-p1_param)))/(LN(x2_param) -

LN(x1_param))

=x1_param/(POWER((-LN(1-p1_param)),(1/Shape_result)))

=Scale_result*POWER(-LN(1-A27),1/Shape_result)

Page 35: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis38

Missing HUGE delays and workload beyond the 95th

Percentile

Page 36: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

39

http://connected-knowledge.com/

Page 37: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis40

Long Tail Distribution Sampling

Good chance of Samples

Low chance of Samples

Page 38: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

41

Hard to sample high-end percentiles…

• You find high end quickly for uniform dist.– 12 samples (50% certain of finding 90% range)

• Not so, for long tail distribution (Eg. Weibull shape: 1.5)

– 88% never found after 1000 trials, avg. 425 if lucky

@t_magennis

From samples (likely in practice)

By Formula (NOT likely in practice)

Page 39: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis42

What is Risk?

95% <= 8.29 Days

Big Risks

How can we identify these?

Page 40: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis43

The RISK is out there…

Lazy

Page 41: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis44

Contact Details

www.FocusedObjective.comDownload latest software, videos, presentations and articles on

forecasting and applied predictive analytics

[email protected] email address for all questions and comments

@t_magennisTwitter feed from Troy Magennis

Page 42: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis45

CASE STUDY: ESTIMATING TOTAL STORY COUNT

Do we have to break down EVERY epic to estimate story counts?

Page 43: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis46

Problem: Getting a high level time and cost estimate for

proposed business strategytime and costs

Approach: Randomly sample epics from the 328 proposed

and perform story breakdown. Then use throughput history to

estimate time and costs

Page 44: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis47

9

5

13 13

11

9

13

117

5

35

14

4 19

1Sum: 51

14751128

35195131183

Trial 1Trial 2 Trial 100

Number of stories

Sample with replacementRemember to put the piece of paper back in after each draw!

Page 45: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis48

Epic Breakdown – Sample Count

Process 50% CI

75% CI

95% CI

MC 48 samples 261 282 315

Actual Sum262

Facilitated by well known consulting company, team performed story breakdown (counts) of epics. 48 (out of 328) epics were analyzed.

Process 50% CI

75% CI

95% CI

MC 48 samples 261 282 315MC 24 samples 236 257 292

Process 50% CI

75% CI

95% CI

MC 48 samples 261 282 315MC 24 samples 236 257 292MC 12 samples 223 239 266

Process 50% CI

75% CI

95% CI

MC 48 samples 261 282 315MC 24 samples 236 257 292MC 12 samples 223 239 266MC 6 samples 232 247 268

Page 46: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis49

PROBLEMS WITH NON-LINEAR SCALES

Page 47: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis50

Fibonacci Bias…

1 2 3 5 8 13 … 21

Team (3 of 130, 82% Median 5) Median Mean SDTeam AProcess Change Team 5 4.4 3Team BUI Software Dev Team 5 5.4 6Team CLibrary Software Dev Team 5 5.7 5.5

Question: What is the

middle value for this scale?

Perceived (5) Mathematical (10.5)

Being < 0 at MEAN – 1 SD should be an

indicator something is

wrong!

Page 48: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis51

Normal?

Expect ~50%

Expect~15%

Expect~35%

Page 49: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis52

Paper: Does the use of Fibonacci numbers in Planning Poker affect effort estimates?

“Conclusion: The use of a Fibonacci scale, and possibly other non-linear scales, is likely to affect the effort

estimates towards lower values compared to linear scales.

A possible explanation for this scale-induced effect is that people tend to be biased towards toward the middle of the

provided scale, especially when the uncertainty is substantial. The middle value is likely to be perceived as

lower for the Fibonacci than for the linear scale.”

https://www.simula.no/publications/Simula.simula.1282

R. Tamrakar and M. Jørgensen (2012)

Page 50: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis53

Really, really, know the question…

• What is the goal or question being asked?• How is this question answered now?

– Good enough? Is it believed?– Current cost OK?

• What data would be necessary to answer this question slightly better?– Is the cost justified?– Would the result be more reliable?

Page 51: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis

Import/Cleaning Tools

54

Re-runnable / Automation

Machine Learning

Importing

Normalizing

Imputing

Visualization

Estimating missing values

Page 52: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis55 Spurious Correlations: http://tylervigen.com/

Page 53: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis56 Spurious Correlations: http://tylervigen.com/

Page 54: Risk Management and Reliable Forecasting using Un-reliable Data (magennis) - LKCE 2014

@t_magennis57

Correlation != Causation

• Criteria for causality– The cause precedes the effect in sequence– The cause and effect are empirically correlated

and have a plausible interaction – The correlations is not spurious

Sources: Kan,2003 pp80 and Babbie, 1986(HTTP://XKCD.COM/552/ CREATIVE COMMONS ATTRIBUTION-NONCOMMERCIAL 2.5 LICENSE)