O'Reilly logo
live online training icon Live Online training

Applying Monte Carlo Simulations In Finance

Analyze and manage financial uncertainty using Python

Deepak Kanungo

Monte Carlo Simulation (MCS) is a powerful numerical computing method that generates numerous probable scenarios of a system whose outcomes are uncertain. MCS is used by professionals to quantify and manage uncertainty endemic in business and financial systems. It was developed during the Second World War by some of the world’s best physicists and mathematicians working on the nuclear weapons program in the US. Now MCS is used by practitioners in almost every field, especially in business and finance.

The importance of MCS in finance cannot be overstated. It is used to value all types of assets, optimize diverse portfolios and estimate complex risks. Indeed, there are many types of financial derivatives—such as lookback options and Asian options—cannot be valued using any other technique. And while the mathematics underpinning MCS is definitely not simple, applying the method is actually quite easy, especially once you understand the key concepts.

However, MCS is no silver bullet and has its share of limitations. Also, given the complexity of financial problems, it is quite common to see MCS being applied incorrectly. This course introduces the key concepts and tools through hands-on exercises, so you can start benefiting from of one of the most powerful numerical computational techniques available in financial data science — while avoiding its potential pitfalls.

What you'll learn-and how you can apply it

By the end of this live, hands-on, online course, you’ll understand:

  • Key statistical concepts underpinning MCS
  • Strengths and weaknesses of MCS
  • The process and tools used for developing a sound MCS
  • How to forecast and quantify the uncertainty in financial value of assets
  • How to estimate and quantify financial risks
  • How correlations among random variables lead to poor estimates and predictions
  • Differences between MCS and historical simulations

And you’ll be able to:

  • Use Python and its libraries to apply MCS to different types of financial problems
  • Quantify the uncertainty in the value of projects
  • Quantify financial risks of credit default or bankruptcy of a customer or supplier
  • Download and process equity market data from freely available sources on the web
  • Analyze, visualize and forecast the future value of an equity or a portfolio of stocks
  • Estimate the probability and possible loss of an equity or portfolio of stocks

This training course is for you because...

  • You are a business manager, project manager, financial analyst, investor or trader who wants to apply MCS to quantify and manage the uncertainty of financial problems.


  • Basic knowledge of Python, NumPy and pandas dataframes
  • Basic knowledge of probability and statistics
  • Create an empty Google Colab notebook

Recommended preparation:


About your instructor

  • Deepak Kanungo is the founder and CEO of Hedged Capital LLC, an AI-powered trading and advisory firm. Previously, Deepak was a financial advisor at Morgan Stanley, a Silicon Valley fintech entrepreneur and a Director in the Global Planning Department at MasterCard International. Deepak was educated at Princeton University (Astrophysics) and The London School of Economics (Finance and Information Systems). Hedged Capital’s trading algorithms use probabilistic models and technologies such as TFP. In 2005, Deepak invented a project portfolio management system using Bayesian Inference, the foundation of all probabilistic programming languages.


The timeframes are only estimates and may vary according to how the class is progressing

Using MCS to analyze and manage financial uncertainty (55 minutes)

  • Poll: (5 minutes)
  • Presentation: Overview of MCS including its strengths and weaknesses. Key concepts underpinning MCS. Process of developing a sound MCS. (30 minutes)
  • Exercise: Setup Jupyter notebook. Show the process of developing an MCS by using it to estimate the value of Pi (15 minutes)
  • Q&A (5 minutes)
  • Break (5 minutes)

Applying MCS to Estimate the Value of Projects (55 minutes)

  • Presentation: Overview of the Net Present Value (NPV) method, it’s limitations and some of the common mistakes in valuing projects using NPV with MCS (25 minutes)
  • Exercise: Use NumPy, pandas dataframes and MCS to estimate the NPV of a project and quantify its uncertainty. (25 minutes)
  • Q&A (5 minutes)
  • Break (5 minutes)

Using MCS for Forecasting Credit Default or Bankruptcy (55 minutes)

  • Presentation: Overview of Credit Value at Risk (CVAR), VaR, modified VaR, and ES, the various methods used in the industry to estimate them, including their strengths and weaknesses (25 minutes)
  • Exercise: Use NumPy, pandas dataframes and MCS to estimate the probability of default and bankruptcy (25 minutes)
  • Q&A (5 minutes)
  • Break (5 minutes)

Applying MCS For Forecasting the Value of Equities and Portfolios (60 minutes)

  • Presentation: Overview of methods used for valuing equities and estimating their risks, including their strengths, and weaknesses. Discuss the differences between historical simulations and MCS. (25 minutes)
  • Exercise: Use pandas dataframes to download, analyze and visualize equity market data. Apply NumPy, historical simulations and MCS to value equities and estimate their risks. (25 minutes)
  • Discussion and Q&A (10 minutes)