Live data from Hacker News

How to replace estimations and guesses with a Monte Carlo simulation

lucasfcosta.com

31–40 of 162 posts

Re: How to replace estimations and guesses with a Monte Carlo simulation

#31
Not to hijack the conversation, but I though some people interested in replacing estimations could find this useful.

In order to replace estimation, we are trying Basecamp's Shapeup language and techniques [1]

In a nutshell the thinking is reversed, instead of asking:

- "how long would it take to implement X?"

you ask:

- "how much appetite (in weeks and people involved) do I have for this feature ?"

Then you work with a fix "dead line" and variable scope.

Instead of user stories, they call it Bets, and they give themselves 2 weeks to shape bets and 6 to implement them (these two cycles can happen in parallel), during those weeks is about leaving the design at the Mockup/sketch level, and identify with help of business and technical people all the possible risks, so the Bet safe becomes a safer Bet.

We are still in the first cycle, and still a lot of questions and doing our own little customisations, but everyone response seems to be positive with the way of working, curious if anyone else has tried succeed and fail.

- [1] https://basecamp.com/shapeup

Re: How to replace estimations and guesses with a Monte Carlo simulation

#32
post #8

I’m a big fan of the Donald Reinertsen approach: measure queue length. Simply track the time to complete each task in the team queue on average, then multiply that by the number of tasks remaining in the queue. Each team will habitually slice things into sizes they feel are appropriate. Rather than investing time to try and fail at accurately estimating each one, simply update your average every time a task is comple…

This is great for a simple monte carlo simulation! Choose a finished tasks time randomly, once per remaining task in the queue, and add this up to be a single estimate. Do this 1000 times or so and get an estimated distribution of completion times for the current queue. This type of thing is covered extensively in Evidence Based Scheduling[0], and is one of the reasons I still think FogBugz ' power is misunderstood.…

Nice, I just recently left a company where this approach would have been tremendously useful and fairly easy to build - we had all the required data already, but were just looking at averages of past performance to budgets and using that as a multiplier on the schedule rather than going through a distribution.

That being said, I also despise tracking time!

…Suppose you could move that technique to story points (or whatever unit of measurement) though you would lose a ton of precision.

Re: How to replace estimations and guesses with a Monte Carlo simulation

#33
I'd love to hear a post mortem blog post on a project that was ran in this way in real life & what the pros/cons at different stages were.

The author first talks about the waste of time that is upfront analysis/planning or adding a buffer for contingency and how Monte Carlo simulation fixes for that, but then the caveats seem to be based on an established team, of a fixed size doing similar style work.

For me, this stage of a project has never faced big hiccups in estimation & our teams are normally quite good at knowing "what's a 2 vs a 5 point story" — if there _is_ a big discussion in a planning meeting at that stage, it's normally because one person has overlooked a key requirement (or the other is assuming a requirement that doesn't exist) so it's a good opportunity to solve for that.

To use the analogy, we're probably quite good in established teams at estimating how long it'll take to write 10 blog posts. The trouble comes when someone says "The latest blog posts aren't generating enough interest. Can you estimate how long it'd take for you to write 10 poems instead? We want a mix of iambic pentameter and maybe some trochaic tetrameter (TBC). We've gotten budget approval to increase the size of the team, so we'll have 5 new people (off-shore) joining next week so we can go faster. Also, some of the old blog posts seem to be getting lots of visitors in South America, so we may need to translate these to Portuguese/Spanish too. When can you give me an estimate for all that?"

Re: How to replace estimations and guesses with a Monte Carlo simulation

#34
post #10

I really dislike posts in this vein, because they use statements like "This post will teach you how to replace estimations and guesses with a Monte Carlo simulation." as though the output of a Monte Carlo simulation were not an estimate, but some higher truth. The process of simulating many different outcomes with a touch of randomness gives the layperson the impression that we are really _doing_ something, when in f…

Monte Carlo simulations are often just a relatively easy way of doing numerical integrations. But it sounds fancy.

I use Monte Carlo simulations because I am not that great at doing complex statistics.

It sounds fancier to say modeled using a Monte Carlo simulation, but in reality it is much easier than working with joint and conditional probabilities.

Re: How to replace estimations and guesses with a Monte Carlo simulation

#35

Now you need to guess the variance and correlation between events, and if you get it badly wrong it ends up like CDOs in ‘08

Let the observed data do the work and remove the guessing by use pairs / trebbles etc. of past events in your simulation.

Re: How to replace estimations and guesses with a Monte Carlo simulation

#36
post #30
post #14

After many decades we still discuss and wonder how work amount estimates should be done and why they are always wrong. The most brilliant software engineers and project managers have developed countless different methods and nothing works. For me it tells that nature of work is such that we just can not estimate work amounts. We are just pretending that it can be done.

Absolutely; we still treat knowledge-based work as if it were factory based with known inputs and outputs (someone can chime in on MBAs etc...)

Are you suggesting that MBA programmes are a factory with known inputs and outputs? Probably a fair critique

Re: How to replace estimations and guesses with a Monte Carlo simulation

#37
I recommend the book "Software Estimation: Demystifying the Black Art" (2006) by Steve McConnell. Nice collection of excerpts: https://leventov.medium.com/excerpts-from-software-estimatio...

There is also a short chapter on estimation tools using e.g. Monte Carlo simulations. One tip which is relevant here and that is also more or less presented in the article and probably obvious :) "TIP #65: Don't treat the output of a software estimation tool as divine revelation. Sanity-check estimation tool outputs just as you would other estimates."

Re: How to replace estimations and guesses with a Monte Carlo simulation

#38
For those who like to do things a little more visually I recommend the open-sourced Argo[0] for microsoft excel.

There's a lot you can do with a monte carlo model. Tornado plots are something I highly recommend for understanding risk profiles around any complex task

[0] https://github.com/boozallen/argo/releases

Re: How to replace estimations and guesses with a Monte Carlo simulation

#39
post #18
post #12

Earlier quoted context omitted.

The real danger is not understanding that this "uncertainty" estimate is a function of your assumptions. How you model the distribution of your inputs is huge, and often not stated clearly. GIGO

GIGO, the first thing I learnt, as I entered the industry 20 years ago. This was from a 60 year old engineer who told me that experience is only a nice name for "all the @#$% I made I will try not to make again". A very nice thing about Monte Carlo simulation is that at the end your distribution of results are all within the feasible range. If you do error propagation using uncertainty on your parameters, you can get…

> A very nice thing about Monte Carlo simulation is that at the end your distribution of results are all within the feasible range.

I guess Monte Carlo helps provide conservative estimates behind a façade of rigour, but the truth of the matter is that in the end it's still GIGO.

Any empirical distribution only reflects the empirical measures that were used to generate it. If you bundle everything from the time it took employee A to walk the dog while allocated to project Foo to the time it took employee Z to fix a nasty Eisenbug while allocated to project Bar, and Foo and Bar used totally different tech stacks and team members and even approaches to project planning, that distribution is meaningless in estimating, say, how much time it will take employee G to implement a React widget.

Re: How to replace estimations and guesses with a Monte Carlo simulation

#40
post #21

I think FogBugz used this method to estimate how long open tickets would take to get closed. Or at least I remember Joel talking about it. I wonder if there are any other issues tracking apps out there making use of this technique

Yeah, FogBugz had a very similar feature 15 years ago.

It was a hybrid between the approach proposed in the article, and the "always multiply by N" technique.

Basically, FogBugz always asked you for your own best estimate. It tracked how much longer the actual time to completion was compared to your best estimate, and learned a simplified statistical distribution of your personal multipliers (e.g. in 80% of cases your estimate was 20% shorter than actual time to completion, in the remaining 20% of cases it was 10% longer).

FogBugz used the learned distribution to perform Monte Carlo simulations, and presented you with estimates of actual time to completion (e.g. "in 95% of simulations the project didn't take longer than 30 work days"). The great thing about this method is that it automatically accounts for chronic optimists, who always think it'll be ready to ship soon, and underestimate difficulty. The learned multipliers tell the algorithm that the estimates made by the optimist tend to be underestimates, so that it can present you with a "debiased" estimates.

E.g. if something always takes at least twice as long as Developer Anderson says it will, then FogBugz would tell you: "Anderson estimated 10 days, but based on past data I think it'll take at least 20, and it took less than 15 only in 5% of the simulations".

It had a very simple algorithm at its core, but the developers were knowledgable ,and had tons of data about project management. This allowed them to add many empirically verified "embellishments" (e.g. if the algorithm didn't have enough data about your specific multipliers, it assumed that your multipliers were about the average of your coworkers'), which made the algorithm surprisingly accurate in the end. Certainly better than any estimates most people could produce by hand.

Post reply on HN