Monte Carlo Simulations in the Teaching Process

Similar documents
CPSC 540: Machine Learning

FREDRIK BAJERS VEJ 7 G 9220 AALBORG ØST Tlf.: URL: Fax: Monte Carlo methods

CPSC 540: Machine Learning

Overview. Transformation method Rejection method. Monte Carlo vs ordinary methods. 1 Random numbers. 2 Monte Carlo integration.

Monte Carlo and Empirical Methods for Stochastic Inference (MASM11/FMS091)

Monte Carlo Methods for Uncertainty Quantification

Definition 9.1 A point estimate is any function T (X 1,..., X n ) of a random sample. We often write an estimator of the parameter θ as ˆθ.

Chapter 7 - Lecture 1 General concepts and criteria

Chapter 7: Point Estimation and Sampling Distributions

Sampling and sampling distribution

Chapter 8. Introduction to Statistical Inference

Monte Carlo and Empirical Methods for Stochastic Inference (MASM11/FMSN50)

Numerical Simulation of Stochastic Differential Equations: Lecture 2, Part 2

Interval estimation. September 29, Outline Basic ideas Sampling variation and CLT Interval estimation using X More general problems

Applied Statistics I

Confidence Intervals Introduction

Strategies for Improving the Efficiency of Monte-Carlo Methods

Chapter 8: Sampling distributions of estimators Sections

Chapter 5. Statistical inference for Parametric Models

Chapter 2 Uncertainty Analysis and Sampling Techniques

Seminar: Efficient Monte Carlo Methods for Uncertainty Quantification

Posterior Inference. , where should we start? Consider the following computational procedure: 1. draw samples. 2. convert. 3. compute properties

MATH 3200 Exam 3 Dr. Syring

Business Statistics 41000: Probability 3

Point Estimators. STATISTICS Lecture no. 10. Department of Econometrics FEM UO Brno office 69a, tel

"Pricing Exotic Options using Strong Convergence Properties

Optimal Search for Parameters in Monte Carlo Simulation for Derivative Pricing

Determining Sample Size. Slide 1 ˆ ˆ. p q n E = z α / 2. (solve for n by algebra) n = E 2

Estimating parameters 5.3 Confidence Intervals 5.4 Sample Variance

Application of MCMC Algorithm in Interest Rate Modeling

F19: Introduction to Monte Carlo simulations. Ebrahim Shayesteh

King s College London

Week 1 Quantitative Analysis of Financial Markets Distributions B

King s College London

Statistics for Business and Economics

Chapter 5: Statistical Inference (in General)

Chapter 14 : Statistical Inference 1. Note : Here the 4-th and 5-th editions of the text have different chapters, but the material is the same.

Lecture 9: Plinko Probabilities, Part III Random Variables, Expected Values and Variances

MAFS Computational Methods for Pricing Structured Products

Simulation Wrap-up, Statistics COS 323

UQ, STAT2201, 2017, Lectures 3 and 4 Unit 3 Probability Distributions.

The Vasicek Distribution

Statistics 13 Elementary Statistics

Point Estimation. Principle of Unbiased Estimation. When choosing among several different estimators of θ, select one that is unbiased.

... About Monte Cario Simulation

Modelling Returns: the CER and the CAPM

Lecture 22. Survey Sampling: an Overview

Monte Carlo Methods for Uncertainty Quantification

Write legibly. Unreadable answers are worthless.

Chapter 8 Statistical Intervals for a Single Sample

χ 2 distributions and confidence intervals for population variance

Lecture 10: Point Estimation

Version A. Problem 1. Let X be the continuous random variable defined by the following pdf: 1 x/2 when 0 x 2, f(x) = 0 otherwise.

IEOR E4703: Monte-Carlo Simulation

1 Explaining Labor Market Volatility

Market Volatility and Risk Proxies

Random Variables Handout. Xavier Vilà

MVE051/MSG Lecture 7

Lecture 17: More on Markov Decision Processes. Reinforcement learning

MATH 10 INTRODUCTORY STATISTICS

Monte Carlo Methods (Estimators, On-policy/Off-policy Learning)

Simulation. LEARNING OBJECTIVES : After studying this chapter, you should be able to :

Stratified Sampling in Monte Carlo Simulation: Motivation, Design, and Sampling Error

EE641 Digital Image Processing II: Purdue University VISE - October 29,

2.1 Mathematical Basis: Risk-Neutral Pricing

Prentice Hall Connected Mathematics, Grade 7 Unit 2004 Correlated to: Maine Learning Results for Mathematics (Grades 5-8)

Implementing hybrid PDE solvers

Point Estimation. Stat 4570/5570 Material from Devore s book (Ed 8), and Cengage

Homework Assignments

Monte Carlo Path Simulation and the Multilevel Monte Carlo Method. Krister Janzon

Two hours. To be supplied by the Examinations Office: Mathematical Formula Tables and Statistical Tables THE UNIVERSITY OF MANCHESTER

Chapter 7: Estimation Sections

Statistics for Managers Using Microsoft Excel 7 th Edition

Actuarial Mathematics and Statistics Statistics 5 Part 2: Statistical Inference Tutorial Problems

Extend the ideas of Kan and Zhou paper on Optimal Portfolio Construction under parameter uncertainty

Lecture 9 - Sampling Distributions and the CLT

Math 416/516: Stochastic Simulation

Monte Carlo and Empirical Methods for Stochastic Inference (MASM11/FMSN50)

History of Monte Carlo Method

Exam in TFY4275/FY8907 CLASSICAL TRANSPORT THEORY Feb 14, 2014

Fast Convergence of Regress-later Series Estimators

Market Risk: FROM VALUE AT RISK TO STRESS TESTING. Agenda. Agenda (Cont.) Traditional Measures of Market Risk

Using Monte Carlo Integration and Control Variates to Estimate π

Section 7-2 Estimating a Population Proportion

Reverse Sensitivity Testing: What does it take to break the model? Silvana Pesenti

Stochastic Differential Equations in Finance and Monte Carlo Simulations

Section 8.2: Monte Carlo Estimation

Prentice Hall Connected Mathematics 2, 7th Grade Units 2009 Correlated to: Minnesota K-12 Academic Standards in Mathematics, 9/2008 (Grade 7)

Statistical estimation

Project 1: Double Pendulum

Financial Risk Forecasting Chapter 7 Simulation methods for VaR for options and bonds

Using Halton Sequences. in Random Parameters Logit Models

Binomial model: numerical algorithm

Chapter 7. Confidence Intervals and Sample Sizes. Definition. Definition. Definition. Definition. Confidence Interval : CI. Point Estimate.

Hedging with Life and General Insurance Products

Enventive Monte Carlo Analysis Tutorial Version 4.1.x

Hand and Spreadsheet Simulations

TEST OF BOUNDED LOG-NORMAL PROCESS FOR OPTIONS PRICING

Chapter 7 Sampling Distributions and Point Estimation of Parameters

The Black-Scholes Equation

Transcription:

Monte Carlo Simulations in the Teaching Process Blanka Šedivá Department of Mathematics, Faculty of Applied Sciences University of West Bohemia, Plzeň, Czech Republic CADGME 2018 Conference on Digital Tools in Mathematics Education 25-29 June 2018 University of Coimbra, Portugal

Outline 1 Motivation 2 The basic philosophy of Monte Carlo methods 3 The classic Monte Carlo applications Calculation of area Demonstration of unbiasedness and interval estimation Buffon s needle 4 Modern Monte Carlo applications Monte Carlo Solution of PDEs 5 Conclusion Blanka Šedivá (Dep. of Math., UWB Pilsen) Monte Carlo Simulations Coimbra, 25-29 June 2018 2 / 22

Motivation Motivation Deterministic and stochastic problems are usually taught separately, without linking. Monte Carlo simulations (MCSs) are procedures for solving nonprobabilistic-type problems (problems whose outcome does not depend on chance) by probabilistic-type methods (methods whose outcome depends on chance). MCSs can be a valuable pedagogical tool for several types of courses - probability, statistics, econometrics but also basic and advanced courses in mathematical analysis. Today s, the using MCSs can help to understand the basic principles of some real problem but it also supports to train students to practical programming in computers. Blanka Šedivá (Dep. of Math., UWB Pilsen) Monte Carlo Simulations Coimbra, 25-29 June 2018 3 / 22

The basic philosophy of Monte Carlo methods A Brief History of Monte Carlo Methods The term Monte Carlo was apparently first used by Ulam and von Neumann as a Los Alamos code word for the stochastic simulations they applied to building better atomic bombs. One of the first documented Monte Carlo experiments is Buffon s needle experiment (1733). In physics or economical-related problems, Monte Carlo methods are useful for simulating systems with many coupled degrees of freedom, such as fluids, disordered materials, strongly coupled solids, cellular structures or calculation of trade price of the derivatives. Blanka Šedivá (Dep. of Math., UWB Pilsen) Monte Carlo Simulations Coimbra, 25-29 June 2018 4 / 22

The basic philosophy of Monte Carlo methods The basic philosophy of Monte Carlo methods MCSs is a part of experimental mathematics. At the first step, the problem is described in the deterministic and the stochastic formulation and the connection between this two views are established. Next the repeated numerical experiments based on the random number are proceeded. By the law of large numbers, the expected value of some random variable can be approximated by taking the empirical mean (the sample mean) of independent samples of the variable. Blanka Šedivá (Dep. of Math., UWB Pilsen) Monte Carlo Simulations Coimbra, 25-29 June 2018 5 / 22

The basic philosophy of Monte Carlo methods Random samples For MCSs we need to be able to reproduce randomness by a computer algorithm. A pseudo-random number generator (RNG) is an algorithm for whose output the U [0, 1] distribution is a suitable model. The number generated by the pseudo-random number generator should have the same relevant statistical properties as independent realisations of a U [0, 1] random variable. The ability of a Monte Carlo method to work depends on the quality random numbers used. Random Number Generators in SW Excel: =rand(), GeoGebra: RandomBetween[ 1, 10 ], MATLAB: rand(), rng(seed), PYTHON: random(), seed(), C++ rand() Blanka Šedivá (Dep. of Math., UWB Pilsen) Monte Carlo Simulations Coimbra, 25-29 June 2018 6 / 22

The classic Monte Carlo applications Calculation of area Calculation of area To compute an MCSs of π using a simple experiment. Assume that we could produce uniform rain on the square [ 1, 1] [ 1, 1] such that the probability of a raindrop falling into a region Ω [ 1, 1] 2 is proportional to the area of Ω, but independent of the position of Ω. The probability that a raindrop falls into the unit circle is P (drop within circle) = π = 4 P (drop within circle) area of the unit circle area of the square = π 2 2. The probability P is estimated using our raindrop experiment. ˆP = number of drops inside the circle. total number of drops Blanka Šedivá (Dep. of Math., UWB Pilsen) Monte Carlo Simulations Coimbra, 25-29 June 2018 7 / 22

The classic Monte Carlo applications Calculation of area, cont. Calculation of area MCSs of π (with 95% confidence interval) Blanka Šedivá (Dep. of Math., UWB Pilsen) Monte Carlo Simulations Coimbra, 25-29 June 2018 8 / 22

The classic Monte Carlo applications Demonstration of unbiasedness Demonstration of unbiasedness and interval estimation If random variables X i are normally distributed iid with mean µ and standard deviation σ then x is the unbias estimators of µ and s is bias estimator of σ. (ˆµ =)... x = 1 n x i, (ˆσ =)... s = 1 n (x i x) 2 n n i=1 In statistics, the bias (or bias function) of an estimator is the difference between this estimator s expected value and the true value of the parameter being estimated. An estimator or decision rule with zero bias is called unbiased. https://en.wikipedia.org/wiki/bias_of_an_estimator ( ) E X µ = 0 E (S) σ 0 E (S) = n n 1 σ i=1 Blanka Šedivá (Dep. of Math., UWB Pilsen) Monte Carlo Simulations Coimbra, 25-29 June 2018 9 / 22

The classic Monte Carlo applications Demonstration of unbiasedness, cont. Demonstration of unbiasedness and interval estimation For fixed n we simulate x 1, x 2,..., x n as a realization of X N(µ, σ) We compute x and s as a estimation of parameters µ and σ. We repeat simulation process and at the end, we calculate mean of your estimated ˆµ and ˆσ. simulation sample µ σ 1 x 11, x 12,..., x 1n x 1 s 1 2 x 21, x 22,..., x 2n x 2 s 1............ k x k1, x k2,..., x kn x k s 1 mean EX ÊS Blanka Šedivá (Dep. of Math., UWB Pilsen) Monte Carlo Simulations Coimbra, 25-29 June 2018 10 / 22

The classic Monte Carlo applications Demonstration of unbiasedness, cont. Demonstration of unbiasedness and interval estimation MCSs demonstration of estimation µ and σ based on iid n samples of normal distributed variable X N(0, 1) Blanka Šedivá (Dep. of Math., UWB Pilsen) Monte Carlo Simulations Coimbra, 25-29 June 2018 11 / 22

The classic Monte Carlo applications Demonstration of interval estimation Demonstration of unbiasedness and interval estimation Confidence intervals consist of a range of potential values of the unknown population parameter. A 95% confidence interval does not mean that 95% of the sample data lie within the interval. ( For Gaussian distribution P x t s < µ < x + t s ) = 1 α n n Blanka Šedivá (Dep. of Math., UWB Pilsen) Monte Carlo Simulations Coimbra, 25-29 June 2018 12 / 22

Buffon s needle The classic Monte Carlo applications Buffon s needle In 1733, the Comte de Buffon, George Louis Leclerc, asked the following question (Buffon, 1733): Consider a floor with equally spaced lines, a distance δ apart. What is the probability that a needle of length l < δ dropped on the floor will intersect one of the lines? Buffon answered the question himself in 1777 (Buffon, 1777). Blanka Šedivá (Dep. of Math., UWB Pilsen) Monte Carlo Simulations Coimbra, 25-29 June 2018 13 / 22

The classic Monte Carlo applications Buffon s needle Solution of the problem Buffon n needle Assume the needle landed such that its angle is θ (see previous figure 1.5). Then the question whether the needle intersects a line is equivalent to the question whether a box of width l sin θ intersects a line. The probability of this happened is P(intersect) = l sin θ δ Assuming that the angle θ is uniform on [0, π) we obtain π P(intersect) = P(intersect θ) 1 π π dθ = l sin θ 1 2l dθ = δ π πδ 0 When dropping n needles the expected number of needles crossing a line is thus X = n 2l πδ. 0 Blanka Šedivá (Dep. of Math., UWB Pilsen) Monte Carlo Simulations Coimbra, 25-29 June 2018 14 / 22

Modern Monte Carlo applications Modern Monte Carlo applications Methods for the solving partial differential and integral equations based on random walks. Credit Risk and the Valuation of Corporate Securities. Valuation of Credit Insurance Portfolios Computing ValueAtRisk (VaR) and Principal Components Analysis (PCA) by MCSs. Stochastic DEs and PDEs. For example calculation of pricing options (European, American and Exotic options). Application in Linear Algebra, that MCSs can be used to approximate sums of huge number of terms such as high-dimensional inner products.... Blanka Šedivá (Dep. of Math., UWB Pilsen) Monte Carlo Simulations Coimbra, 25-29 June 2018 15 / 22

Modern Monte Carlo applications Monte Carlo Solution of PDEs Monte Carlo Solution of PDEs Approximate solution of the Dirichlet problem. Problem : to find u(x, y) that satisfies PDE: u xx + u yy = 0 x Ω BC: u(x, y) = g(x, y) x Ω Ω = { [x, y] R 2 : 0 < x < 1, 0 < y < 1 } g(x, y) = { 1 on the top of the square 0 on the sides and bottom of the square To illustrate the Monte Carlo method in this problem, we introduce a game called tour du wino. To play it, we need a board on which grid lines are drown on the next slide. Blanka Šedivá (Dep. of Math., UWB Pilsen) Monte Carlo Simulations Coimbra, 25-29 June 2018 16 / 22

Modern Monte Carlo applications Monte Carlo Solution of PDEs Random walk process The process starts from an arbitrary point (fill red point). At each stage of the game, the wino staggers off randomly to one of the four neighbouring points. The process wandering from point to point until eventually hitting a boundary point (blue point). Blanka Šedivá (Dep. of Math., UWB Pilsen) Monte Carlo Simulations Coimbra, 25-29 June 2018 17 / 22

Simulation process Modern Monte Carlo applications Monte Carlo Solution of PDEs For every interior point we repeat many random walk. Keep track of how many times you hit each boundary point. Compute the fraction of times you have ended at each boundary points p i. Suppose that the goal of the game is to compute his average value U(A) for all this walks. The average reward is U(A) = g i P(p i ) where g i is value of function g(x, y) at boundary point p i, P(p i ) is probability that random walk finish at point p i Probability is estimated by the fraction of times. Blanka Šedivá (Dep. of Math., UWB Pilsen) Monte Carlo Simulations Coimbra, 25-29 June 2018 18 / 22

Modern Monte Carlo applications Results of simulation process Monte Carlo Solution of PDEs The ending points for n = 100 simulation random walk started at the red point. Blanka Šedivá (Dep. of Math., UWB Pilsen) Monte Carlo Simulations Coimbra, 25-29 June 2018 19 / 22

Modern Monte Carlo applications Monte Carlo Solution of PDEs The relation between the MCSs and solving of the Laplace problem. Average value U(A) is clearly the average of the four average values of the four neighbours. U(A) = 1 4 (U(A N) + U(A S ) + U(A W ) + U(A E )) U(A) corresponds to u i;j in the finite difference equations u i;j = 1 ( ) 4 ui 1;j + u i+1;j + u i;j 1 + u i;j+1 for (i; j) interior point u i;j = g i;j for (i; j) boundary point U(A) will approximate the true solution of the PDE at the point A. Blanka Šedivá (Dep. of Math., UWB Pilsen) Monte Carlo Simulations Coimbra, 25-29 June 2018 20 / 22

Modern Monte Carlo applications Monte Carlo Solution of PDEs The Monte Carlo solution of PDEs The step for grid 0.025 and number of simulations s = 100 The step for grid 0.025 and number of simulations s = 500 Blanka Šedivá (Dep. of Math., UWB Pilsen) Monte Carlo Simulations Coimbra, 25-29 June 2018 21 / 22

Conclusion Conclusion The Monte Carlo methods are useful for explain not only probabilistic and statistics problems but also for geometric interpretations problems from mathematical analysis. Thank you for your attention. Blanka Šedivá (Dep. of Math., UWB Pilsen) Monte Carlo Simulations Coimbra, 25-29 June 2018 22 / 22