O'Reilly logo
live online training icon Live Online training

Applying Monte Carlo simulations in finance

Analyze and manage financial uncertainty using Python

Topic: Data
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. And while the math underpinning MCS is definitely not simple, applying the method is actually quite easy, especially once you understand the basics.

Expert Deepak Kanungo introduces key MCS concepts and tools through hands-on exercises. Join in to start benefiting from 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 online course, you’ll understand:

  • Key statistical concepts underpinning MCS
  • The strengths and weaknesses of MCS
  • The process and tools used to develop 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 and the 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...

This course is for you because…

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


Prerequisites: - Basic knowledge of Python, NumPy, and pandas dataframes - Familiarity with probability and statistics

Recommended preparation: - Create an empty Google Colab notebook - Explore “Seeing Theory” for a visual overview of probability and statistics - Read Chapters 4 and 5 in Python for Finance, second edition (book)

Recommended follow-up: - Finish Python for Finance, second edition (book) - Read Handbook in Monte Carlo Simulation: Applications in Financial Engineering, Risk Management and Economics (book) - Complete Hands-On Algorithmic Trading with Python (learning path)

About your instructor

  • Deepak Kanungo is the founder and CEO of Hedged Capital LLC, an AI-powered trading and advisory firm that uses probabilistic models and technologies. In 2005, Deepak invented a project portfolio management system using Bayesian inference, the foundation of all probabilistic programming languages. 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. He was educated at Princeton University (astrophysics) and the London School of Economics (finance and information systems).


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)

  • Group discussion: What’s your level of experience in Python and statistics?
  • Lecture: Overview of MCS, including its strengths and weaknesses; key concepts underpinning MCS; the process of developing a sound MCS
  • Hands-on exercise: Set up your Colab notebook; walk through the process of developing an MCS by using it to estimate the value of Pi
  • Q&A

Break (5 minutes)

Applying MCS to estimate the value of projects (55 minutes) - Lecture: Overview of the net present value (NPV) method and its limitations; some of the common mistakes in valuing projects using NPV with MCS - Hands-on exercise: Use NumPy, pandas dataframes, and MCS to estimate the NPV of a project and quantify its uncertainty - Q&A

Break (5 minutes)

Using MCS to forecast credit default or bankruptcy (55 minutes)

  • Lecture: 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
  • Hands-on exercise: Use NumPy, pandas dataframes, and MCS to estimate the probability of default and bankruptcy
  • Q&A

Break (5 minutes)

Applying MCS to forecast the value of equities and portfolios (50 minutes) - Lecture: Overview of methods used for valuing equities and estimating their risks, including their strengths, and weaknesses; the differences between historical simulations and MCS - Hands-on exercises: Use pandas dataframes to download, analyze, and visualize equity market data; apply NumPy, historical simulations, and MCS to value equities and estimate their risks

Wrap-up and Q&A (10 minutes)