DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Data Engineering
  3. AI/ML
  4. Agility Meets AI: Hands-On with Monte Carlo Simulation

Agility Meets AI: Hands-On with Monte Carlo Simulation

Let's check out an exploration of the Monte Carlo Simulation, one of the amazing concepts in Artificial Intelligence.

Ramesh Manickavel user avatar by
Ramesh Manickavel
CORE ·
Aug. 27, 18 · Tutorial
Like (9)
Save
Tweet
Share
32.78K Views

Join the DZone community and get the full member experience.

Join For Free

After my article, “Role of Project Manager in Data Science”, a couple of program managers suggested me to elaborate the use case on meeting release commitments. We are going to explore simulation, one of the amazing concepts in Artificial Intelligence. Quantitative analytic techniques, such as the Monte Carlo simulation, helps program managers in decision making through probabilistic distributions of potential outcomes.

Monte Carlo relies heavily on the randomness of key variables in solving the problem. Along with key parameters, we also need to understand the relationship between them and sufficient data to analyze further. The five steps listed in “Forecasting the future: Let’s rewind to the basics” are essential to building an accurate model.

For a deep dive into the Monte Carlo simulation in program management, this link may be helpful.

Let's do a hands-on experiment with a case study most of us are familiar with, using MS Excel.

Example Case Study

Shubham is the CEO of company XYZ. After release planning, his team committed to delivering key functionalities to the customer. Mohit, his program manager, has identified challenges in meeting the target delivery date based on risks and burndown summary that he has been tracking:

Burndown Summary

Mohit: Boss, we may not be able to deliver all the committed items as per our initial plan.

Shubham: That’s not a great news Mohit. Can you elaborate more on this?

Mohit: Since the team is working on prioritized requirements, we are on track to deliver the high priority items, but we have challenges in completing our remaining work based on the velocity we have burnt so far and the changes to our planned scope.

Shubham: Okay, what do you suggest?

Mohit:  Let us split the deliverables into two phases. All the high priority items required for the customer’s trade show will be delivered as per plan. We need to replan for the remaining work.

Shubham: Sounds like a plan. I, along with the release management team, will discuss this with our customers. Though the remaining items are relatively low in priority, we still need to provide a date that we can stick to. Can you provide your recommendation with a solid plan? Let us ensure this exercise doesn’t impact our team.

Mohit: Yes boss!

The solid plan means a higher probability of meeting the commitment for the remaining work. Let us help Mohit here with step-by-step guidelines on Monte Carlo simulation. Mohit’s objective is to find optimistic and pessimistic options based on the historical velocity with associated randomness.

This spreadsheet has the summary of the below steps.

Step 1: Identifying the Seeding Function

In our scenario, since we know our lowest and highest velocity, and we can come up with something like MIN (Actual Velocity in last 3 sprints)+RAND()*(MAX(Actual Velocity in last 3 sprints)-MIN (Actual Velocity in last 3 sprints))

We can choose any function (such as adding risk or scope parameters), but for simplicity, I chose this as velocity typically considers effort, complexity, and uncertainty involved during sizing.

Step 2: Setting up the Trials

The industry standard suggests at least 10000 runs for Monte Carlo simulation. Since we are doing it in excel anyway, we can target 15000 runs (or more). Setup a column for Trials numbering from 1 to 15000.

Step 3: Randomizing the Runs

Setup another column for Velocity with the first run as the seeding function (as described in Step 1). We now have two columns with 15000 rows where the first column is filled with runs and second column is filled with just the value for the first run. To randomize all runs, we need to follow the below:

  • Select the cells that hold the value “1” (under “Trial” column) and the seeding value (under “Velocity” column)
  • Press Ctrl + Shift + Down Arrow Key (we now have 2 rows x 15000 columns selected)
  • Select Data -> What-If Analysis -> Data Table
  • Click on Column Input Cell entry and select any cell from our spreadsheet that doesn’t hold any value
  • Bingo… the 15000 cells under column “Velocity” hold the randomized runs
  • Click on File -> Options -> Formulas -> Workbook calculation -> “Automatic” if you want to refresh the data frequently.

Step 4: Plotting Histogram

  • To plot the frequency distribution, we first need to bin (bucketizing)
  • Let’s bin velocity starting from 400 till 625 with increment of 25
  • Click on Data -> Analysis -> Data Analysis
    • If you don’t find this, you need to add this through File -> Options -> Add-ins -> Manage -> Excel Add-ins -> ‘Go’ -> Enable ‘Analysis ToolPak’
  • Click Histogram -> Input Range (Col 1 to Col 15000 that holds random value of "Velocity"), Bin Range (Col 1 to Coln that holds the bin value of 400, 425, …625). You can check other checkboxes. You will get bin summary and histogram as below:

Bin Summary

Probability Distribution

Now, Mohit can provide various options to his CEO – optimistic (maybe 500 story points velocity at 33%) or pessimistic (maybe 575 story points velocity at 83%). Then based on remaining effort, Mohit can figure out how many additional sprints we need.

While this problem sounds straightforward, to calculate the number of sprints required based on historical velocity, Monte Carlo builds provide a better range of possible outcomes with associated probabilities, especially when the seeding function is set right as discussed above.

To summarize, the Monte Carlo simulation is effective when combined with domain knowledge, identifying parameters that influence the decisions, collecting associated data, and setting up a proper experiment with a good amount of trials. Like any other model, this needs a constant feedback mechanism to improve prediction accuracy.

AI Velocity (JavaScript library) Database Data (computing)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Three SQL Keywords in QuestDB for Finding Missing Data
  • Connecting Your Devs' Work to the Business
  • Problems of Cloud Cost Management: A Socio-Technical Analysis
  • A Simple Union Between .NET Core and Python

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: